use std::process::Command;

fn exmaple() {
    let output = Command::new("uv")
        .env("OPENAI_API_KEY", "sk-5K6dRzMA2eWXj3Rot4PGAQcAmDKeaD9VeSkKLzV0KTMXb3Rd")
        .env("OPENAI_API_BASE", "https://api.hunyuan.cloud.tencent.com/v1")
        .arg("run")
        .arg("mcp-cli")
        .arg("chat")
        .output()
        .expect("failed to execute process");

    println!("stdout:\n{}", String::from_utf8_lossy(&output.stdout));
    eprintln!("stderr:\n{}", String::from_utf8_lossy(&output.stderr));
}


#[cfg(test)]
mod tests {
    use std::error::Error;

    use super::*;

    #[test]
    fn test_example_ls() -> Result<(), Box<dyn Error>> {
        let output = Command::new("ls")
        .arg("-al")
        .output()
        .expect("failed to execute process");

        println!("stdout:\n{}", String::from_utf8_lossy(&output.stdout));
        eprintln!("stderr:\n{}", String::from_utf8_lossy(&output.stderr));
        Ok(())
    }
}